import http from '../http'

/**
 * 轮播图
 * @param data
 */
export function getBannerList(data: { type: string }) {
  return http.get('index/getBannerList', {
    params: {
      ...data
    }
  })
}
/**
 * 藏品列表
 * @param data
 */
export function getCollectionList(data: { page: number; page_size: number }) {
  return http.get('collection/getList', {
    params: {
      ...data
    }
  })
}
/**
 * 藏品详情
 * @param data
 */
export function getCollectionDetail(data: { collection_id: string }) {
  return http.get('collection/getDetail', {
    params: {
      ...data
    }
  })
}
/**
 * 寄售详情
 * @param data
 */
export function getNumberDetail(data: { number_id: string }) {
  return http.get('collection/getNumberDetail', {
    params: {
      ...data
    }
  })
}
/**
 *.305.生成订单（流转中心购买）
 * @param
 */
export function generateOrder(data: { number_id: string }) {
  return http.post('order/generateOrder', data)
}

/**
 * 206.盲盒详情
 * @param data
 */
export function getBoxDetail(data: { box_id: string }) {
  return http.get('box/getBoxDetail', {
    params: {
      ...data
    }
  })
}
/**
 * 编号列表
 * @param data
 */
export function getOneCollectionAllNumbers(data: {
  page: number
  page_size: number
  collection_id: string
  sale_status: string
  sort_rule: string
  sort_type: string
}) {
  return http.get('collection/getOneCollectionAllNumbers', {
    params: {
      ...data
    }
  })
}

/**
 * .盲盒列表
 * @param data
 */
export function getBoxList(data: { page: number; page_size: number }) {
  return http.get('box/getBoxList', {
    params: {
      ...data
    }
  })
}
/**
 * .发售日历
 * @param data
 */
export function calendarList(data: { page: number; page_size: number }) {
  return http.get('collection/calendarList', {
    params: {
      ...data
    }
  })
}
/**
 * .抢购藏品
 * @param data
 */
export function snapUpCollection(data: { collection_id: string }) {
  return http.post('collection/snapUpCollection', data)
}
/**
 * .抢购盲盒
 * @param data
 */
export function snapUpBox(data: { box_id: string }) {
  return http.post('box/snapUpBox', data)
}
/**
 * .210.订单详情
 * @param data
 */
export function getOrderDetail(data: { order_sn: string }) {
  return http.get('order/getOrderDetail', {
    params: {
      ...data
    }
  })
}
/**
 * .211.订单支付
 * @param data
 */
export function payOrder(data: {
  order_sn: string
  pay_type: string
  pay_password: string
}) {
  return http.post('order/payOrder', data)
}
